﻿using System.ComponentModel.DataAnnotations;
using Fee.Orders;

namespace Fee
{
    /// <summary>
    ///     委托任务
    /// </summary>
    public class ConstructionDetail : DelegateOrderDetail
    {
        public ProcessInfo ProcessInfo { get; set; } = new ProcessInfo();
        public ConstructionDetailStatus Status { get; set; }
        public int TaskId { get; set; }


        public DelegateOrderDetail CreateOrderDetail()
        {
            var result = new DelegateOrderDetail
            {
                Contract = Contract,
                ContractType = ContractType,
                ConstructionType = ConstructionType,
                SourceConstructionDetailId = Id == 0 ? null : new int?(Id),
                Operator = this.Operator,
                Project = Project
            };

            return result;
        }
    }

    public enum ConstructionDetailStatus
    {
        [Display(Name = "预委托状态")] Unconfirm,
        [Display(Name = "委托状态")] Confirm
    }
}